/**
 * Created by wenchuan.li on 2018/09/28.
 * 归属法人
 */
define(function () {

    var self,
        app = win.app,
        orderSubmitArg;

    var fr = app.Module.extend({

        init: function () {
            self = this;
            self._super({
                _limit: 100000,
                _refreshAutoInit: true //自动加载刷新控件
            }, win);
            orderSubmitArg = self._pageParameters;
        },
        _initRefresh: function () { // 实例化刷新组件
            if (self._refreshIds.length == 0) {
                self._refreshIds = ['scroll1'];
            }
            this._super(win);
        },
        _refreshCb: function (goods) {// 刷新组件回调函授
            var _super = this._super;
            app.ajax({
                xurl: "api/wx/gwat300/getSys001",
                xdata: {
                    page:goods.page+1,
                    limit: goods.limit
                },
                cb: function (result) {
                    if (result.ok) {
                        var data = result.data;
                        _super({
                            obj: goods,
                            data: data.data,
                            nodata: '无经归属法人信息...'
                        });
                    }
                }
            });
        },
        _lazy: function () {
            this._super();

        },
        _ready: function () {

            Vue.component('fritem', {
                template: app.getByid(doc, 'frsitem-template'),
                props: {
                    model: Array
                },
                methods: {
                    select: function (v) {
                        orderSubmitArg.cb(v);
                        app.back(1);
                    }
                }
            });
        }
    });

    return new fr();

});